
//
//  OrderInfoCell.m
//  LuxuryGoods
//
//  Created by DCQ on 2018/5/29.
//  Copyright © 2018年 Future. All rights reserved.
//

#import "OrderInfoCell.h"
#import "OrderListModel.h"
@interface OrderInfoCell ()
@property (weak, nonatomic) IBOutlet UILabel *numberLabel;
@property (weak, nonatomic) IBOutlet UILabel *dateLabel;
@property (weak, nonatomic) IBOutlet UILabel *stateLabel;
@property (copy, nonatomic)  NSString *orderNo;
@end
@implementation OrderInfoCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (void)setupADdressData:(id)data withState:(NSString *)state{
    
    OrderInfoModel * model =  data;
    self.orderNo = model.order_no;
    self.numberLabel.text = [@"订单编号："  stringByAppendingString:model.order_no];
    self.dateLabel.text = [@"下单时间：" stringByAppendingString:model.createtime];
    self.stateLabel.text =  [@"订单状态：" stringByAppendingString: state];
}
- (IBAction)copyAction:(id)sender {
    
    UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
    pasteboard.string = self.orderNo;
    [SVProgressHUD showInfoWithStatus:@"复制成功"];
}
- (NSString *)getStateWithStyle:(NSInteger )style{
    NSString * stateStr = @"";
    //订单状态 0-待付款 10-待发货 20-待收货 30-待评价 40-已完成 50-退款中 51-退款被拒绝 60 -退款成功 90-已取消
    switch (style) {
        case 0:
            stateStr = @"待付款";
            
            break;
        case 10:
            stateStr = @"待发货";
            
            break;
        case 20:
            stateStr = @"待收货";
            
            break;
        case 30:
            stateStr = @"待评价";
            
            break;
        case 40:
            stateStr = @"已完成";
            
            break;
        case 50:
            stateStr = @"退款中";
            
            break;
        case 51:
            stateStr = @"退款被拒绝";
            
            break;
        case 60:
            stateStr = @"退款成功";
            
            break;
        case 90:
            stateStr = @"取消";
            
            break;
        default:
            break;
    }
    return stateStr;
}
@end
